<template>
	<view class="devicerelation">
		<view class="con_item">
			<view class="con_title">激活时间</view>
			<view class="con_text">{{deviceData.bind_time}}</view>
		</view>
		<view class="con_item">
			<view class="con_title">设备ID号</view>
			<view class="con_text">{{deviceData.imei}}</view>
		</view>
		<view class="con_item">
			<view class="con_title">关联人</view>
			<view class="con_text">{{deviceData.realname}}<text style="margin-left: 5px;">AID{{deviceData.aid}}</text></view>
		</view>
		<view class="con_item">
			<view class="con_title">设备类型</view>
			<view class="con_text">{{deviceData.series_name}}</view>
		</view>
	</view>
</template>

<script>
	import { devicebinddetail } from '../../api/index.js'
	export default {
		data() {
			return {
				deviceData:{}
			}
		},
		onLoad:function(data){
			this.getDevicebinddetail(data.imei)
		},
		methods: {
			getDevicebinddetail:function(imei){
				let that = this;
				devicebinddetail({
					imei:imei
				}).then((res) => {
					console.log(res);
					if(res.code == 0){
						that.deviceData = res.data;
					}else{
						uni.showToast({
							title: res.msg,
							icon: 'none'
						})
					}
				}).catch((e)=>{
					console.log(e);
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.devicerelation{
		font-size: $uni-font-size-base;
		padding: 0 30rpx 0 30rpx;
		.con_item{
			display: flex;
			padding: 30rpx 0;
			border-bottom: 1rpx $uni-border-color-e5 solid;
			.con_title{
				color: #999999;
				width: 35%;
			}
		}
	}
</style>
